<%--
  Created by IntelliJ IDEA.
  User: caojian
  Date: 2017/3/10
  Time: 下午5:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>修改小区</title>
    <jsp:include page="common/common_css.jsp"/>
</head>
<body>
<jsp:include page="common/header.jsp"/>
<div class="ui main container">
    <div class="ui middle aligned center aligned grid">
        <div class="column">
            <jsp:include page="common/message.jsp"/>
            <div style="border: 1px solid rgba(34,36,38,.15);padding: 0.5em;margin-bottom: 20px;">
                <form class="ui large form" method="post"
                      action="${pageContext.request.contextPath}/xiaoqu/${xiaoqu.id}">
                    <label>修改小区</label>
                    <div class="ui stacked segment">
                        <div class="field">
                            <div class="ui labeled input">
                                <div class="ui label">
                                    小区ID：
                                </div>
                                <input disabled type="text" value="${xiaoqu.id}">
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui labeled input">
                                <div class="ui label">
                                    小区名字：
                                </div>
                                <input name="name" type="text" value="${xiaoqu.name}" maxlength="50">
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui labeled input">
                                <div class="ui label">
                                    小区经度：
                                </div>
                                <input name="longitude" type="number" value="${xiaoqu.longitude}" readonly="true">
                            </div>
                        </div>
                        <div class="field">
                            <div class="ui labeled input">
                                <div class="ui label">
                                    小区纬度：
                                </div>
                                <input name="latitude" type="number" value="${xiaoqu.latitude}" readonly="true">
                            </div>
                        </div>
                        <div class="field">
                            <a href="${pageContext.request.contextPath}/location?callback=/xiaoqu/${xiaoqu.id}">重新定位>></a>
                        </div>
                        <button class="ui fluid large teal submit button">完成修改</button>
                        <div id="JS-error-message" class="ui error message"></div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<jsp:include page="common/footer.jsp"/>
<jsp:include page="common/common_js.jsp"/>
<script>
    $(function () {
        $('.ui.form')
            .form({
                fields: {
                    name: {
                        identifier: 'name',
                        rules: [
                            {
                                type: 'empty',
                                prompt: '小区名不能为空。'
                            }
                        ]
                    }
                }
            })
        ;
    });
</script>
</body>
</html>
